本文整理汇总了C++中setSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setSize函数的具体用法?C++ setSize怎么用?C++ setSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: size
/// If the requested size is larger than the current capacity, then the
/// buffer will be resized.
void size(int n){
if(capacity() < n) resize(n);
else setSize(n);
}
示例2: locateROI
UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
{
UMat hdr;
if(!data)
return hdr;
if (data != datastart)
{
Size wholeSize;
Point ofs;
locateROI(wholeSize, ofs);
Size sz(cols, rows);
if (ofs.x != 0 || ofs.y != 0)
{
Mat src = *this;
int dtop = ofs.y;
int dbottom = wholeSize.height - src.rows - ofs.y;
int dleft = ofs.x;
int dright = wholeSize.width - src.cols - ofs.x;
src.adjustROI(dtop, dbottom, dleft, dright);
return src.getUMat(accessFlags, usageFlags)(cv::Rect(ofs.x, ofs.y, sz.width, sz.height));
}
}
CV_Assert(data == datastart);
accessFlags |= ACCESS_RW;
UMatData* new_u = NULL;
{
MatAllocator *a = allocator, *a0 = getDefaultAllocator();
if(!a)
a = a0;
new_u = a->allocate(dims, size.p, type(), data, step.p, accessFlags, usageFlags);
}
bool allocated = false;
try
{
allocated = UMat::getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
}
catch (const cv::Exception& e)
{
fprintf(stderr, "Exception: %s\n", e.what());
}
if (!allocated)
{
allocated = getDefaultAllocator()->allocate(new_u, accessFlags, usageFlags);
CV_Assert(allocated);
}
if (u != NULL)
{
#ifdef HAVE_OPENCL
if (ocl::useOpenCL() && new_u->currAllocator == ocl::getOpenCLAllocator())
{
CV_Assert(new_u->tempUMat());
}
#endif
new_u->originalUMatData = u;
CV_XADD(&(u->refcount), 1);
CV_XADD(&(u->urefcount), 1);
}
hdr.flags = flags;
setSize(hdr, dims, size.p, step.p);
finalizeHdr(hdr);
hdr.u = new_u;
hdr.offset = 0; //data - datastart;
hdr.addref();
return hdr;
}
示例3: setSize
Rectangle::Rectangle(int w, int h){
setSize(w, h);
}
示例4: setSize
MovableBox::MovableBox()
:mBoxAnimation("data/images/movableblock.bmp",1)
,mGravityHitTimer(0)
{
setSize(float2(20.f,20.f));
}
示例5: mTextIsSet
QgsLabelAttributes::QgsLabelAttributes( bool def )
: mTextIsSet( false )
, mFamilyIsSet( false )
, mBoldIsSet( false )
, mItalicIsSet( false )
, mUnderlineIsSet( false )
, mStrikeOutIsSet( false )
, mSizeType( 0 )
, mSize( 0.0 )
, mSizeIsSet( false )
, mColorIsSet( false )
, mOffsetType( 0 )
, mXOffset( 0 )
, mYOffset( 0 )
, mOffsetIsSet( false )
, mAngle( 0.0 )
, mAngleIsSet( false )
, mAngleIsAuto( false )
, mAlignment( 0 )
, mAlignmentIsSet( false )
, mBufferEnabledFlag( false )
, mBufferSizeType( 0 )
, mBufferSize( 0.0 )
, mBufferSizeIsSet( false )
, mBufferColorIsSet( false )
, mBufferStyleIsSet( false )
, mBorderColorIsSet( false )
, mBorderWidthIsSet( false )
, mBorderStyleIsSet( false )
, mMultilineEnabledFlag( false )
, mSelectedOnly( false )
{
if ( def ) // set defaults
{
setText( QObject::tr( "Label" ) );
mFont = QApplication::font();
mFamilyIsSet = true;
mBoldIsSet = true;
mItalicIsSet = true;
mUnderlineIsSet = true;
setSize( 12.0, PointUnits );
setOffset( 0, 0, PointUnits );
setAngle( 0 );
setAutoAngle( false );
setAlignment( Qt::AlignCenter );
setColor( QColor( 0, 0, 0 ) );
setBufferSize( 1, PointUnits );
setBufferColor( QColor( 255, 255, 255 ) );
setBufferStyle( Qt::NoBrush );
setBorderWidth( 0 );
setBorderColor( QColor( 0, 0, 0 ) );
setBorderStyle( Qt::NoPen );
}
}
示例6: setSize
U8* LLImageBase::allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 size)
{
setSize(width, height, ncomponents);
return allocateData(size); // virtual
}
示例7: label
//==============================================================================
ThorConfigComponent::ThorConfigComponent (ThorConfig *_config)
: label (0),
thorConfigEncodeFormat (0),
label2 (0),
thorOggQuality (0),
thorVersionCheck (0),
label3 (0),
thorOutputAction (0),
internalCachedImage1 (0)
{
addAndMakeVisible (label = new Label (T("new label"),
T("Ogg quality")));
label->setFont (Font (12.0000f, Font::plain));
label->setJustificationType (Justification::centredLeft);
label->setEditable (false, false, false);
label->setColour (TextEditor::textColourId, Colours::black);
label->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (thorConfigEncodeFormat = new ComboBox (T("new combo box")));
thorConfigEncodeFormat->setEditableText (false);
thorConfigEncodeFormat->setJustificationType (Justification::centredLeft);
thorConfigEncodeFormat->setTextWhenNothingSelected (String::empty);
thorConfigEncodeFormat->setTextWhenNoChoicesAvailable (T("(no choices)"));
thorConfigEncodeFormat->addItem (T("Ogg"), 1);
thorConfigEncodeFormat->addItem (T("Flac"), 2);
thorConfigEncodeFormat->addListener (this);
addAndMakeVisible (label2 = new Label (T("new label"),
T("Encode To:")));
label2->setFont (Font (12.0000f, Font::plain));
label2->setJustificationType (Justification::centredLeft);
label2->setEditable (false, false, false);
label2->setColour (TextEditor::textColourId, Colours::black);
label2->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (thorOggQuality = new ComboBox (T("Ogg Quality")));
thorOggQuality->setEditableText (false);
thorOggQuality->setJustificationType (Justification::centredLeft);
thorOggQuality->setTextWhenNothingSelected (String::empty);
thorOggQuality->setTextWhenNoChoicesAvailable (T("(no choices)"));
thorOggQuality->addItem (T("Low"), 1);
thorOggQuality->addItem (T("Medium"), 2);
thorOggQuality->addItem (T("High"), 3);
thorOggQuality->addListener (this);
addAndMakeVisible (thorVersionCheck = new ToggleButton (T("new toggle button")));
thorVersionCheck->setButtonText (T("version check"));
thorVersionCheck->addButtonListener (this);
thorVersionCheck->setToggleState (true, false);
addAndMakeVisible (label3 = new Label (T("new label"),
T("Output:")));
label3->setFont (Font (12.0000f, Font::plain));
label3->setJustificationType (Justification::centredLeft);
label3->setEditable (false, false, false);
label3->setColour (TextEditor::textColourId, Colours::black);
label3->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (thorOutputAction = new ComboBox (T("Ogg Quality")));
thorOutputAction->setEditableText (false);
thorOutputAction->setJustificationType (Justification::centredLeft);
thorOutputAction->setTextWhenNothingSelected (String::empty);
thorOutputAction->setTextWhenNoChoicesAvailable (T("(no choices)"));
thorOutputAction->addItem (T("Kepp and create ZIP"), 1);
thorOutputAction->addItem (T("Keep output DIR (no ZIP)"), 2);
thorOutputAction->addItem (T("Keep both"), 3);
thorOutputAction->addListener (this);
internalCachedImage1 = ImageCache::getFromMemory (vorbis_png, vorbis_pngSize);
//[UserPreSize]
config = _config;
//[/UserPreSize]
setSize (256, 106);
//[Constructor] You can add your own custom stuff here..
thorOggQuality->setSelectedItemIndex (config->getOggQuality(), false);
thorVersionCheck->setToggleState (config->getVersionCheck(), false);
thorOutputAction->setSelectedItemIndex (config->getDefaultOutputAction(), false);
if (config->getFileExtension() == T("flac"))
{
thorConfigEncodeFormat->setSelectedId (2);
}
if (config->getFileExtension() == T("ogg"))
{
thorConfigEncodeFormat->setSelectedId (1);
}
//[/Constructor]
}
示例8: while
bool RVPFile::msnftp() {
bool error = false;
while (!completed) {
char *params = "";
char *line = connection->recvLine();
if (line != NULL && strlen(line) > 2) {
if (strlen(line) > 3) {
params = line + 4;
}
int command = (int)line[0] | (((int)line[1]) << 8) | (((int)line[2]) << 16);
command = (command&0x00FFFFFF)|0x20000000;
switch (command) {
case ' REV':
{
char protocol[7];
bool msnftp = false;
while (params != NULL && sscanf(params, "%6s", protocol) >= 1) {
if (strcmp(protocol, "MSNFTP") == 0) {
msnftp = true;
break;
}
params = strstr(params, " ");
if (params != NULL) params ++;
}
if (getMode() == RVPFile::MODE_SEND) {
connection->send("VER MSNFTP\r\n");
} else {
if (msnftp) {
connection->sendText("USR %s %s\r\n",getLogin(),getAuthCookie());
} else {
/* error */
}
}
}
break;
case ' RSU':
{
char email[130], cookie[14];
if (sscanf(params,"%129s %13s",email, cookie) >= 2) {
if (!strcmp(email, getLogin()) && !strcmp(cookie, getAuthCookie())) {
connection->sendText("FIL %i\r\n", getSize());
} else {
/* error */
}
break;
}
}
break;
case ' LIF':
{
char filesize[ 30 ];
if ( sscanf( params, "%s", filesize ) >= 1 ) {
setSize(atol(filesize));
connection->send("TFR\r\n");
/* ack initializing */
if (listener != NULL) {
listener->onFileProgress(this, RVPFileListener::PROGRESS_INITIALIZING, 0);
}
/* receive data */
int fileId = _open(getPath(), _O_BINARY|_O_WRONLY|_O_CREAT|_O_TRUNC, _S_IREAD|_S_IWRITE);
error = false;
if (fileId >= 0) {
int bytesToReceive = getSize();
while (!error && bytesToReceive > 0) {
char buffer[2048];
int header = 0;
if (connection->recv((char *)&header, 3)) {
int blockSize = header >> 8;
while (!error && blockSize > 0) {
error = true;
int readSize = min(2048, blockSize);
if (connection->recv(buffer, readSize)) {
blockSize -= readSize;
bytesToReceive -= readSize;
if (_write(fileId, buffer, readSize) == readSize) {
error = false;
}
}
}
if (listener != NULL) {
listener->onFileProgress(this, RVPFileListener::PROGRESS_PROGRESS, getSize() - bytesToReceive);
}
if (header&0xFF != 0) {
break;
}
} else {
error = true;
}
}
_close(fileId);
} else {
error = true;
}
completed = true;
}
示例9: setSize
// update track on resize
void Slider::setSize(int _width, int _height)
{
setSize(IntSize(_width, _height));
}
示例10: Component
//==============================================================================
Threshold::Threshold ()
: Component (L"Threshold"),
groupComponent (0),
threshold_levelslider (0),
label (0),
textButton (0),
toggleButton (0),
resetbutton (0),
label2 (0),
textButton2 (0)
{
addAndMakeVisible (groupComponent = new GroupComponent (L"new group",
L"Threshold"));
groupComponent->setTextLabelPosition (Justification::centredLeft);
groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000));
addAndMakeVisible (threshold_levelslider = new Slider (L"new slider"));
threshold_levelslider->setRange (0, 10, 0);
threshold_levelslider->setSliderStyle (Slider::LinearHorizontal);
threshold_levelslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
threshold_levelslider->setColour (Slider::backgroundColourId, Colour (0x956565));
threshold_levelslider->setColour (Slider::thumbColourId, Colour (0x6efffcfc));
threshold_levelslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff));
threshold_levelslider->addListener (this);
addAndMakeVisible (label = new Label (L"new label",
L"Threshold level (0-10)"));
label->setFont (Font (15.0000f, Font::plain));
label->setJustificationType (Justification::centredLeft);
label->setEditable (false, false, false);
label->setColour (Label::backgroundColourId, Colour (0x0));
label->setColour (Label::textColourId, Colours::black);
label->setColour (Label::outlineColourId, Colour (0x0));
label->setColour (TextEditor::textColourId, Colours::black);
label->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (textButton = new TextButton (L"new button"));
textButton->setButtonText (L"Do it!");
textButton->addListener (this);
textButton->setColour (TextButton::buttonColourId, Colour (0x40bbbbff));
addAndMakeVisible (toggleButton = new ToggleButton (L"new toggle button"));
toggleButton->setButtonText (L"Remove above threshold");
toggleButton->addListener (this);
addAndMakeVisible (resetbutton = new TextButton (L"resetbutton"));
resetbutton->setButtonText (L"reset");
resetbutton->addListener (this);
resetbutton->setColour (TextButton::buttonColourId, Colour (0x3bbbbbff));
addAndMakeVisible (label2 = new Label (L"new label",
L"Removes all partials below a given amplitude threshold."));
label2->setFont (Font (15.0000f, Font::plain));
label2->setJustificationType (Justification::centredLeft);
label2->setEditable (false, false, false);
label2->setColour (Label::backgroundColourId, Colour (0x0));
label2->setColour (Label::textColourId, Colours::black);
label2->setColour (Label::outlineColourId, Colour (0x0));
label2->setColour (TextEditor::textColourId, Colours::black);
label2->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (textButton2 = new TextButton (L"new button"));
textButton2->setButtonText (L"Redo it!");
textButton2->addListener (this);
textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
buttonClicked(resetbutton);
#undef Slider
//[/Constructor]
}
示例11: png_get_image_width
void PNGImageDecoder::headerAvailable()
{
png_structp png = m_reader->pngPtr();
png_infop info = m_reader->infoPtr();
png_uint_32 width = png_get_image_width(png, info);
png_uint_32 height = png_get_image_height(png, info);
// Protect against large PNGs. See http://bugzil.la/251381 for more details.
const unsigned long maxPNGSize = 1000000UL;
if (width > maxPNGSize || height > maxPNGSize) {
longjmp(JMPBUF(png), 1);
return;
}
// Set the image size now that the image header is available.
if (!setSize(width, height)) {
longjmp(JMPBUF(png), 1);
return;
}
int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);
// The options we set here match what Mozilla does.
// Expand to ensure we use 24-bit for RGB and 32-bit for RGBA.
if (colorType == PNG_COLOR_TYPE_PALETTE || (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8))
png_set_expand(png);
png_bytep trns = 0;
int trnsCount = 0;
if (png_get_valid(png, info, PNG_INFO_tRNS)) {
png_get_tRNS(png, info, &trns, &trnsCount, 0);
png_set_expand(png);
}
if (bitDepth == 16)
png_set_strip_16(png);
if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png);
#if USE(QCMSLIB)
if ((colorType & PNG_COLOR_MASK_COLOR) && !m_ignoreGammaAndColorProfile) {
// We only support color profiles for color PALETTE and RGB[A] PNG. Supporting
// color profiles for gray-scale images is slightly tricky, at least using the
// CoreGraphics ICC library, because we expand gray-scale images to RGB but we
// do not similarly transform the color profile. We'd either need to transform
// the color profile or we'd need to decode into a gray-scale image buffer and
// hand that to CoreGraphics.
bool sRGB = false;
ColorProfile colorProfile;
getColorProfile(png, info, colorProfile, sRGB);
bool imageHasAlpha = (colorType & PNG_COLOR_MASK_ALPHA) || trnsCount;
m_reader->createColorTransform(colorProfile, imageHasAlpha, sRGB);
m_hasColorProfile = !!m_reader->colorTransform();
}
#endif
if (!m_hasColorProfile) {
// Deal with gamma and keep it under our control.
const double inverseGamma = 0.45455;
const double defaultGamma = 2.2;
double gamma;
if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
const double maxGamma = 21474.83;
if ((gamma <= 0.0) || (gamma > maxGamma)) {
gamma = inverseGamma;
png_set_gAMA(png, info, gamma);
}
png_set_gamma(png, defaultGamma, gamma);
} else {
png_set_gamma(png, defaultGamma, inverseGamma);
}
}
// Tell libpng to send us rows for interlaced pngs.
if (interlaceType == PNG_INTERLACE_ADAM7)
png_set_interlace_handling(png);
// Update our info now.
png_read_update_info(png, info);
channels = png_get_channels(png, info);
ASSERT(channels == 3 || channels == 4);
m_reader->setHasAlpha(channels == 4);
if (m_reader->decodingSizeOnly()) {
// If we only needed the size, halt the reader.
#if PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5)
// '0' argument to png_process_data_pause means: Do not cache unprocessed data.
m_reader->setReadOffset(m_reader->currentBufferSize() - png_process_data_pause(png, 0));
#else
m_reader->setReadOffset(m_reader->currentBufferSize() - png->buffer_size);
png->buffer_size = 0;
#endif
}
}
示例12: mSpikeTile
Spike::Spike()
: mSpikeTile(Resource::getBitmap("data/images/tileset1.bmp"), 70, 0, 10, 10)
{
setSize(float2(10,10));
}
示例13: deviceManager
//==============================================================================
AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_),
thread ("audio file preview"),
directoryList (0, thread),
zoomLabel (0),
thumbnail (0),
startStopButton (0),
fileTreeComp (0),
explanation (0),
zoomSlider (0)
{
addAndMakeVisible (zoomLabel = new Label (String::empty,
L"zoom:"));
zoomLabel->setFont (Font (15.0000f, Font::plain));
zoomLabel->setJustificationType (Justification::centredRight);
zoomLabel->setEditable (false, false, false);
zoomLabel->setColour (TextEditor::textColourId, Colours::black);
zoomLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (explanation = new Label (String::empty,
L"Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."));
explanation->setFont (Font (14.0000f, Font::plain));
explanation->setJustificationType (Justification::bottomRight);
explanation->setEditable (false, false, false);
explanation->setColour (TextEditor::textColourId, Colours::black);
explanation->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (zoomSlider = new Slider (String::empty));
zoomSlider->setRange (0, 1, 0);
zoomSlider->setSliderStyle (Slider::LinearHorizontal);
zoomSlider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
zoomSlider->addListener (this);
zoomSlider->setSkewFactor (2);
addAndMakeVisible (thumbnail = new DemoThumbnailComp (formatManager, transportSource, *zoomSlider));
addAndMakeVisible (startStopButton = new TextButton (String::empty));
startStopButton->setButtonText (L"Play/Stop");
startStopButton->addListener (this);
startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f));
addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
formatManager.registerBasicFormats();
directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);
thread.startThread (3);
fileTreeComp->setColour (FileTreeComponent::backgroundColourId, Colours::white);
fileTreeComp->addListener (this);
deviceManager.addAudioCallback (&audioSourcePlayer);
audioSourcePlayer.setSource (&transportSource);
//[/Constructor]
}
示例14: AudioProcessorEditor
//==============================================================================
PluginEditor::PluginEditor (PluginProcessor& p)
: AudioProcessorEditor (&p),
buttonAB ("A-B"),
buttonCopyAB ("Copy"),
backgroundImage {ImageCache::getFromMemory (BinaryData::BalanceWidth_02fs8_png,
BinaryData::BalanceWidth_02fs8_pngSize)},
knobStyleImage {ImageCache::getFromMemory (BinaryData::knob05LargeForeground4fs8_png,
BinaryData::knob05LargeForeground4fs8_pngSize)},
filmstripImage {ImageCache::getFromMemory (BinaryData::markerFilmstripfs8_png,
BinaryData::markerFilmstripfs8_pngSize)},
processor (p)
{
// Button AB
buttonAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
buttonAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
addAndMakeVisible (buttonAB);
buttonAB.addListener (this);
// Button copy
buttonCopyAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
buttonCopyAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
addAndMakeVisible (buttonCopyAB);
buttonCopyAB.addListener (this);
// StepSize slider
String stepSizeParamName = processor.getParam(0).name; // magic constant!
Slider* stepSizeSlider = new Slider (stepSizeParamName);
jassert (stepSizeSlider);
sliders.add (stepSizeSlider);
stepSizeSlider->setSliderStyle (Slider::LinearHorizontal);
stepSizeSlider->setTextBoxStyle (Slider::TextBoxLeft,false,60,15); // magic constants!
stepSizeSlider->setColour (Slider::textBoxTextColourId, Colour (0xff373737));
stepSizeSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0xff707070));
stepSizeSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xffffffff));
stepSizeSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000));
addAndMakeVisible (stepSizeSlider);
stepSizeSlider->addListener (this);
// StepSize label
Label* stepSizeLabel = new Label (stepSizeParamName, stepSizeParamName);
jassert (stepSizeLabel);
labels.add (stepSizeLabel);
stepSizeLabel->setJustificationType (Justification::centredLeft);
stepSizeLabel->setEditable (false, false, false);
stepSizeLabel->setColour (Label::textColourId, Colour (0xff2b2b2b));
addAndMakeVisible (stepSizeLabel);
// Main knob
knob = new FilmStrip {filmstripImage, knobStyleImage};
sliders.add (knob);
knob->setDoubleClickReturnValue (true, sliders[0]->getValue()); // current getValue() is
// the default value (0dB)
addAndMakeVisible (knob);
knob->addListener (this);
// Init and size setting
updateSlidersFromProcParams(); // set slider values and ranges
setSize (400, 400); // must be set before xtor finished
startTimerHz (30);
}
示例15: setSize
void Image::setScale(const QSizeF& scale)
{
setSize(sizeForScale(scale));
}