首页 \ 问答 \ QwtPlot更新自定义轴(QwtPlot updating custom axis)

QwtPlot更新自定义轴(QwtPlot updating custom axis)

使用Qwt我必须使用自定义x轴制作绘图,我可以在程序执行时更改缩放标签。 为了做到这一点,我从QwtScaleDraw重载了label ,如下所示:

H-文件:

class TimeScaleDraw : public QwtScaleDraw
{
public:
    TimeScaleDraw();
    virtual QwtText label(double) const;
    void setTimeScale(double factor, QString unit);
private:
    double factor;
    QString unit;
};

CPP-文件:

TimeScaleDraw::TimeScaleDraw()
{
    factor = 1.0;
    unit = "s";
}

QwtText TimeScaleDraw::label(double val) const
{
    return QwtText(QString::number(val*factor) + unit);
}

void TimeScaleDraw::setTimeScale(double factor, QString unit)
{
    this->factor = factor;
    this->unit = unit;
}

如果我从我的Qt窗口构造函数中调用方法setTimeScale(2.0, "sec) ,这可以正常工作。但是如果我尝试调用方法,例如按下按钮,那么它什么都没做?我试过调用replot()updateAxes()但这没有任何改变。

有什么建议么?


Using Qwt I have to make a plot with a custom x-axis, where I can change the scale labels under program execution. In order to do so i have overloaded label from QwtScaleDraw like this:

H-file:

class TimeScaleDraw : public QwtScaleDraw
{
public:
    TimeScaleDraw();
    virtual QwtText label(double) const;
    void setTimeScale(double factor, QString unit);
private:
    double factor;
    QString unit;
};

Cpp-file:

TimeScaleDraw::TimeScaleDraw()
{
    factor = 1.0;
    unit = "s";
}

QwtText TimeScaleDraw::label(double val) const
{
    return QwtText(QString::number(val*factor) + unit);
}

void TimeScaleDraw::setTimeScale(double factor, QString unit)
{
    this->factor = factor;
    this->unit = unit;
}

This works fine if i call the method setTimeScale(2.0, "sec) from my Qt window constructor. But if i try to call the method when eg. a button is pushed, then it does not do anything? I have tried by calling replot() and updateAxes() but this changes nothing.

Any suggestions?


原文:https://stackoverflow.com/questions/35841496
更新时间:2023-01-05 15:01

最满意答案

无法将更高版本的SQL Server附加到较低版本(您的错误消息948非常清楚)。

版本706是SQL Server 2012,版本661是SQL Server 2008R2。 您必须将SQL Server升级到更高版本。


You cannot attach a SQL Server of higher version to a lower version(your error Msg 948 makes it very clear).

Version 706 is SQL Server 2012 and Version 661 is SQL Server 2008R2. You have to upgrade your SQL Server to the higher version.

相关问答

更多
  • 10.50.2500.0实际上是2008 R2与Service Pack 1 Service Pack 1解决了R2 RTM中的许多问题 - 有关详细信息,请参阅该Service Pack发行说明: http://social.technet.microsoft.com/wiki/contents/articles/2973.microsoft-sql-server-2008-r2-sp1-release-notes.aspx 和 http://support.microsoft.com/kb/246333 ...
  • 没有简单的属性可以切换到可以恢复到旧版本。 您可以在Management Studio中尝试以下操作: 选择您的源数据库 选择任务>生成脚本。 选择'脚本整个数据库和所有数据库对象',按'下一步' 选择“保存到文件”并点击“高级”按钮 选择'Script for Server Version'并选择你想要的版本:2000/2005/2008 选择'脚本数据类型'并选择Schema / Data / both 点击“确定”,然后执行操作! 将生成的文件复制到目标机器。 登录到您的SQL Management ...
  • R2实例是64位吗? 在这种情况下,您需要确保安装了64位Jet驱动程序。 Is the R2 instance 64bit by any chance? In that case you need to make sure you have the 64bit Jet drivers installed.
  • 你尝试过什么? 什么不起作用? 最直接的解决方案是通过SQL身份验证(用户/密码)访问数据库并使用类似于下面的连接字符串,其中datasource是您的数据库本地IP地址
  • Id=NetworkName\\UserName 听起来有点奇怪,试试吧 Id=username 此外,如果您可以使用MS VS,MS SMS或任何其他可能的工具连接到数据库,您的应用程序可以连接传递完全相同的参数。 其他要检查的事项:运行应用程序的实际用户(可能是IIS_USR)在SMS或VS中,您可以获取正在使用的实际连接字符串,只需复制它即可。 Id=NetworkName\\UserName sounds a bit strange, try Id=username Also if you ...
  • 根据Microsoft的这篇文章 , Only members of the sysadmin fixed server role can create and alter UNSAFE assemblies. 您需要将当前登录名添加到sysadmin fixed server role. 我目前没有我的管理工作室,但我相信这会奏效: USE YOURDATABASENAME GO EXEC sp_addsrvrolemember 'YOURUSERNAME', 'sysadmin'; Accordin ...
  • 如您所述: 无法进行直接还原。 在将数据库从较新版本还原到具有旧版本的服务器的意义上,SQL Server从未向后兼容。 你可以做的是使用生成的INSERT语句(直接使用SSMS,或SSMS Toolpack等方便的加载项 ),或者你可以使用一个好的SQL DIFF工具,如Red-Gate SQL Data Compare来比较你的两个数据库(甚至来自专业版中的备份文件!)并从另一个更新一个。 As you noted: the direct restore cannot be done. SQL Serv ...
  • 您无法将更高版本的SQL Server附加到较低版本(您的错误消息948非常清楚)。 版本706是SQL Server 2012,版本661是SQL Server 2008R2。 您必须将SQL Server升级到更高版本。 You cannot attach a SQL Server of higher version to a lower version(your error Msg 948 makes it very clear). Version 706 is SQL Server 2012 and ...
  • 你不能 。 期。 这对于SQL Server来说是不可能的(而且很可能永远不会)。 如果您拥有2008 R2版本的数据库备份文件, 则在任何情况下都不能将任何技巧或工具还原到2008版本中。 只是不能做到。 您需要找到一种使用脚本执行此操作的方法(例如编写SQL结构和/或数据),或者您可以使用结构/数据比较工具,如Red-Gate SQL Compare和Red-Gate SQL Data Compare进行比较两个数据库。 使用Red-Gate的工具,您还可以比较2008年的实时数据库和2008 R2备份 ...
  • 我认为该问题与在D:\ Data文件夹中创建mdf文件有关。 您是否可以验证您是否拥有该位置所需的权限以及您是否有足够的可用空间? 此外,请确保该位置上没有该名称的mdf文件。 I would assume the issue has to do with the creation of the mdf file in your D:\Data folder. Can you verify that you have the permissions you need to that location and ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)